package cn.lanqiao.springboot.service;

import cn.lanqiao.springboot.entity.Menu;
import cn.lanqiao.springboot.mapper.MenuMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class MenuService {
    @Autowired
    MenuMapper menuMapper;

    @Cacheable(value = "menu_list", key = "#roleId")
    public List<Menu> selectAllMenus(int roleId) {
        return menuMapper.selectAllMenus(roleId);
    }
}
